package com.cennavi.mineplay.mineplay_data.model.transform.inter;

import com.cennavi.mineplay.mineplay_data.model.TrackPoint;

public class TransformImpl implements Transform{
	
//	private TrackPoint trackPoint;
	
//	public void trans(TrackPoint tp){
//		TrackPoint trackPoint = tp;
//		double lon = tp.getLng();
//		double lat = tp.getLat();
//		try {
//			Gps gcj02GPSCoordinate = PositionUtil.gps84_To_Gcj02(lon, lat);
//			tp.setLng(gcj02GPSCoordinate.getLon());
//			tp.setLat(gcj02GPSCoordinate.getLat());
//		} catch (Exception e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		
//	}
	
	public TrackPoint trans(TrackPoint tp){
		TrackPoint trackPoint = tp;
		double lon = trackPoint.getLng();
		double lat = trackPoint.getLat();
		try {
			Gps gcj02GPSCoordinate = PositionUtil.gps84_To_Gcj02(lon, lat);
			trackPoint.setLng(gcj02GPSCoordinate.getWgLon());
			trackPoint.setLat(gcj02GPSCoordinate.getWgLat());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return trackPoint;
	}
}
